package com.fesine.ch02.setNewPropertiesLockOne;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/8 16:15
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/8 16:15
 */
public class Service {
    public void serviceMethodA(UserInfo userInfo) {
        synchronized (userInfo) {
            try {
                System.out.println(Thread.currentThread().getName());
                userInfo.setUsername("abcabcabc");
                Thread.sleep(3000);
                System.out.println("end! time=" + System.currentTimeMillis());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
